package com.yantong.constant;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

/**
 * 提现申请状态
 * @author kanghaixin
 * @date 2018/9/16.15:37
 */
public enum CashStatus {
    DISABLED(-1, "无效"),
    UNKNOWN(0, "未知"),
    APPLY(1, "申请中"),
    CHECKED(2, "审核通过"),
    COMPLETED(3,"已打款")
    ;

    private int code;
    private String desc;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    CashStatus(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private static Map<Integer, String> all= new HashMap<>();
    static{
        for(CashStatus cashStatus: EnumSet.allOf(CashStatus.class)){
            all.put(cashStatus.code, cashStatus.desc);
        }
    }
    public static String get(Integer code){
        return all.get(code);
    }
}
